// src/api/service.ts
import service from '@/utils/axiosRequest';

export interface Pat {
    [key: string]: any;
}

export interface RequestConfig {
    url: string;
    method: 'get' | 'post' | 'put' | 'delete' | 'patch';
    data?: Pat;
    params?: Pat;
    headers?: any;
}

export function requestInt(params: RequestConfig) {
    const { url, method, data, headers } = params;
    return service({
        url: url,
        method: method,
        data: method === 'get' ? {} : data,
        params: method === 'get' ? data : {},
        headers: headers,
    });
}
